const san = require('/js-modules/common/san/san.js')
const he = require('/js-modules/common/he.js');
const VipLevel = san.defineComponent({
  template: `
        <template>
            <span 
              s-if="level>0"
              class="san-vip-icon iconfont"
              style="font-size:14px;color:{{fontColor[level]}}"
            >{{fontCode[level] | dealIconFont}}</span>
        </template>
    `,
  initData() {
    return {
      level: 0,
      fontCode: ['&#xe77a;', '&#xe779;', '&#xe777;', '&#xe775;', '&#xe776;'],
      fontColor: ['#656665', '#ff892a', '#5990ec', '#10c94c', '#e73634']
    }
  },
  filters:{
    dealIconFont(value){
      return he.decode(value);
    }
  }
})

module.exports = VipLevel;